package multithreading;

import java.util.concurrent.*;

/**
 * 线程池
 */
public class ThreadPoolExecutors {
    public static void main(String[] args) {
        ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor(
                3,
                16,
                60,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(2),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy()
        );
        poolExecutor.submit(new myRunnable());
        poolExecutor.submit(new myThread());
    }
}
